import request from '../../../public/utils/request';

export default {
    /**
     * 查询单据列表
     * @param {Object} data
     * @returns {Promise}
     */
    getIntellctfillQueryList(data) {
        return request('/nccloud/erm/ersetting/IntellectfillQueryAction.do', { data });
    },
       /**
     * 保存单据列表
     * @param {Object} data
     * @returns {Promise}
     */
    saveBillData(data) {
        return request('/nccloud/erm/ersetting/IntellectfillSaveAction.do', { data });
    },

    /**
     * 导入功能
     * @param {Object} data
     * @returns {Promise}
     */
    importBillData(data) {
        return request('/nccloud/erm/ersetting/IntellectfillImportAction.do', { data });
    },

    /**
     * 导出功能
     * @param {Object} data
     * @returns {Promise}
     */
    exportBillData(data) {
        return request('/nccloud/erm/ersetting/IntellectfillExportAction.do', { data });
    },

    /**
     * 启停功能
     * @param {Object} data
     * @returns {Promise}
     */
    startOrStopBillData(data) {
        return request('/nccloud/erm/ersetting/IntellectfillStartOrStopAction.do', { data });
    },

    /**
     * 快速复制
     * @param {Object} data
     * @returns {Promise}
     */
    copyBillData(data) {
        return request('/nccloud/erm/ersetting/IntellectfillCopyAction.do', { data });
    },
    
    /**
     * 获取业务单元数据
     * @param {Object} data
     * @returns {Promise}
     */
    getTableData: (opt) => {
        ajax({
            url: `/nccloud/erm/expamortize/ExpAmortizeViewAction.do`,
            data: opt.data,
            success: (data) => {
                opt.success(data);
            }
        })
    },


    /**
     * 编辑状态下的状态改变的接口
     * @param {Object} data
     * @returns {Promise}
     */
    valueChange: (opt) => {
        ajax({
            url: `${requestDomain}/nccloud/erm/billcontrast/BillContrastChangeAction.do`,
            data: opt.data,
            success: (data) => {
                if (data.success) {
                    data = data.data;
                    opt.success(data);
                }
            }
        })
    },



    /**
     * 查询单据跳转数据
     * @param {Object} data
     * @returns {Promise}
     */
    getBillLinkInfo(data) {
        return request('/nccloud/erm/ersetting/IntellctfillQueryAction.do', { data });
    },
    /**
     * 删除单据
     * @param {Object} data
     * @returns {Promise}
     */
    deleteBill(data) {
        return request('/nccloud/erm/billmanage/BillDeleteAction.do', { data });
    },
    /**
     * 提交单据
     * @param {Object} data
     * @returns {Promise}
     */
    submitBill(data) {
        return request('/nccloud/erm/billmanage/BillSubmitAction.do', { data });
    },
    /**
     * 收回单据
     * @param {Object} data
     * @returns {Promise}
     */
    retrieveBill(data) {
        return request('/nccloud/erm/billmanage/BillRecallAction.do', { data });
    },
    /**
     * 交易类型查询
     * @param {Object} data
     * @returns {Promise}
     */
    getTradeType(data) {
        return request('/nccloud/erm/billmanage/UserTradeTypeQueryAction.do', { data });
    },
    /**
     * 校验是否可以复制
     * @param {Object} data
     * @returns {Promise}
     */
    checkBillCopyStatus(data) {
        return request('/nccloud/erm/billmanage/BillCopyAction.do', { data });
    }
};
